/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { message } from 'antd';

export default function checkFileSize(file: any) {
  const { type } = file;
  const fileType = type.split('/')[1];
  const hasAccept = ['jpeg', 'png', 'jpg'].includes(fileType);

  if (!hasAccept) {
    message.error('仅支持png、jpg、jpeg格式');
    return false;
  } else {
    return true;
  }
}
